package com.bosch.in.rtp1.ept.manager;

import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.List;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;

import org.apache.poi.ss.usermodel.Workbook;

import com.bosch.in.rtp1.ept.model.dto.DurationColorCon;
import com.bosch.in.rtp1.ept.model.dto.ReleasedHold;
import com.bosch.in.rtp1.ept.model.technical.Condition4ReleasedHold;

public interface ReleasedHoldManager {

	/**
	 * Query to get list of released holds. 
	 * @param condition		pagination condition
	 * @return list of released holds
	 * @throws SQLException
	 */
	List<ReleasedHold> getReleasedHolds(Condition4ReleasedHold condition) throws SQLException;
	
	/**
	 * Get list of released holds from database and populate it to excel sheet.
	 * @param searchCriteria	SQL condition criteria
	 * @return	excel object
	 * @throws SQLException 
	 * @throws IOException 
	 */
	Workbook exportToExcel(Condition4ReleasedHold searchCriteria, InputStream is, DurationColorCon durCorCon) throws SQLException, IOException ;
	
	/**
	 * Get releasedhold list from database and populate it to pdf file.
	 * @param searchCriteria		SQL condition criteria
	 * @param is					inputStream to pdf template file which is filled by ReleasedHold list
	 * @return pdf object
	 * @throws SQLException 
	 * @throws JRException 
	 */
	JasperPrint exportPdf(Condition4ReleasedHold searchCriteria, InputStream is) throws SQLException, JRException ;
	
	/**
	 * Update ReleaseHolds
	 * @param releaseHolds list to be updated
	 * @return	true if success
	 * @throws SQLException
	 */
	boolean updateReleasedHolds(List<ReleasedHold> releaseHolds) throws SQLException;
}
